package com.dmwork.service.work.feign;

import com.dmwork.common.base.result.R;
import com.dmwork.service.work.feign.impl.CustomerFeignServiceFallback;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@FeignClient(name = "service-customer-center", fallback = CustomerFeignServiceFallback.class)
public interface CustomerFeignService {

    /**
     * 根据customerId批量获取用户粗略信息
     * @param customerIdList
     * @return  data中：result。HashMap < String, List < String > >, key为用户id，值为一个列表：第一个元素为用户名，第二个元素为头像
     */
    @PostMapping("/front/dm_work/customer/feign/get_base_info_list")
    R getBriefInfoList(@RequestBody List<String> customerIdList);

    /**
     * 获取用户的基本信息
     * data中：customerName -> 用户名，avatar->用户头像
     *
     * @param customerId
     * @return
     */
    @GetMapping("/front/dm_work/customer/feign/get_base_info/{customerId}")
    R getBaseInfo(@PathVariable("customerId") String customerId);

    @ApiOperation("获取所有关注的用户的基本信息")
    @GetMapping("/front/dm_work/customer/feign/get_followed_customer_base_info_list/{followerId}")
    R getFollowedCustomerBaseInfoList(@PathVariable("followerId") String followerId);

}
